import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/Login.vue'
import Register from '../views/Register.vue'
import Personal from '@/views/Personal'
// import  Data from '@/components/Data'
import Upload from '@/views/Upload'
import Home from '../views/home.vue'
// import MyUpload from '@/components/MyUpload'
import TableComponents from '../components/TableComponents.vue'
import Admin from '@/views/admin'
import Courses from '../views/course.vue'

Vue.use(VueRouter)

const router = new VueRouter({
  mode: "history",
  routes: [
    {
      path: "/",
      redirect: "/login"
    },
    {
      path: "/login",
      component: Login,
      meta: {
        keepAlive: false
      }
    },
    {
      path: "/register",
      component: Register,
      meta: {
        keepAlive: false
      }
    },
    {
      path: "/personal",
      component: Personal,
      meta: {
        keepAlive: true
      }
    },
    // {
    //   path:"/mydata",
    //   component:Data
    // },
    {
      path: "/upload",
      component: Upload,
      meta: {
        keepAlive: true
      }
    },
    // {
    //   path:"/myupload",
    //   component:MyUpload
    // }

    {
      path: "/TableComponents",
      component: TableComponents,
      meta: {
        keepAlive: true
      }
    },
    {
      path: "/Home",
      component: Home,
      meta: {
        keepAlive: true
      }
    },
    {
      path: "/admin",
      component: Admin
    },
    {
      path: "/course",
      component: Courses,
      meta: {
        keepAlive: true
      }
    },
  ]
});
export default router